package me.zhengjie.modules.rest.enterprise;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import me.zhengjie.annotation.AnonymousAccess;
import me.zhengjie.modules.domain.enterprise.EnterpriseIndustry;
import me.zhengjie.modules.service.EnterpriseIndService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api("所属行业Api")
@RestController
@RequiredArgsConstructor
@RequestMapping("/enterInd")
public class EnterpriseIndController {

    private final EnterpriseIndService enterpriseIndService;

    @ApiOperation("查询所有行业")
    @AnonymousAccess
    @GetMapping("/queryAllMenuParentIsNull")
    public List<EnterpriseIndustry> queryAllMenuParentIsNull(){
        return enterpriseIndService.queryAllMenuParentIsNull();
    }

    @ApiOperation("根据企业名称查询该企业行业信息")
    @AnonymousAccess
    @GetMapping("/queryMenuByName")
    public EnterpriseIndustry queryMenuByName(String name){
        return enterpriseIndService.queryMenuByName(name);
    }
}
